export type Hook = {
    compressFiles: () => Promise<void> | void;
    uploadZipFolder: () => Promise<void> | void;
};
// Global hook management center
const hooks = {
    compressFiles: [] as Hook["compressFiles"][],
    uploadZipFolder: [] as Hook["uploadZipFolder"][],
};
// run hook
export async function runHook<N extends keyof typeof hooks>(name: N, ...args: Parameters<Hook[N]>) {
    for (const hook of hooks[name]) {
        // @ts-ignore
        await hook(...args);
    }
}
// register hook
export function onCompressFiles(fn: Hook["compressFiles"]) {
    hooks.compressFiles.push(fn);
}
export function onUploadZipFolder(fn: Hook["uploadZipFolder"]) {
    hooks.uploadZipFolder.push(fn);
}
